package edu.sctu.practice.class01.nieyu.test.test12;

/**
 * Created by Administrator on 2015/10/22.
 */
public class Auto {

    int tireNum;
    String color;
    int weight;
    int speed;

    public Auto() {

    }

    public Auto(int tireNum, String color, int weight, int speed) {

        this.tireNum = tireNum;
        this.color = color;
        this.weight = weight;
        this.speed = speed;

    }

    public Auto(int tireNum, int speed) {

        this.tireNum = tireNum;
        this.speed = speed;

    }

    public Auto(String color, int weight) {

        this.color = color;
        this.weight = weight;

    }

    //加速
    public void speedUp(int speed) {

        this.speed += speed;
        System.out.println("我加速了！");

    }

    public void slowDown(int speed) {

        this.speed -= speed;
        System.out.println("我减速了！");

    }

    public void stop() {

        this.speed = 0;
        System.out.println("我停下来了！");

    }
}
